package spring.beans;

import org.springframework.beans.BeansException;

/**
 * bean的生命周期：bean的后置处理器
 *
 * @author jiangbang
 * @date 2016/10/24
 */
public class BeanPostProcessor implements org.springframework.beans.factory.config.BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("结束之后");
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
        System.out.println("开始之前");
        return null;
    }
}
